﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace XBD.MyFristSWJPro
{
    public partial class FrmLogin : Form
    {
        public FrmLogin()
        {
            InitializeComponent();
        }
        //从数据库查询用户名和密码是否正确  
        //Ctrl+K+D  代码对齐 前提没有语法错误
        //需要连接数据库;前期默认 admin 123
        private void btn_Login_Click(object sender, EventArgs e)
        {
            if (this.txt_UserName.Text == "admin" && this.txt_PassWord.Text == "123")
            {
                MessageBox.Show("登录成功");
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                MessageBox.Show("用户名或密码错误,登录失败");
            }
        }

        private void btn_Cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
